<template>
  <div class="user-query">
    <div class="title">查看成员资料</div>
    <div class="box-info">
      <div class="base" v-if="hasMember">
        <div class="photo" v-for="item in memberList" @click="showInfo">
          <img src="../../assets/images/menber1.jpg" />
          <span class="name">{{item.name}}</span>
        </div>
      </div>

      <span class="none-base" v-else>
        <span class="none-member">当前没有可查看的成员资料</span>
      </span>
      <Modal v-model="checkInfo" width="30%">
        <p slot="header">
          <Icon type="information-circled"></Icon>
          <span>成员资料</span>
        </p>
        <div style="text-align:center; padding-right:20px">
          <Form :model="baseInfo" :label-width="80">
            <!-- <div class="form-item">
                  <span> 姓名:</span>
                  <div class="item-input">
                    <Input v-model="baseInfo.name" :placeholder="baseInfo.name"></Input>
                  </div>
                </div> -->
            <FormItem label="姓名:">
              <Input v-model="baseInfo.name"></Input>
            </FormItem>
            <FormItem label="性别: ">
              <Input v-model="baseInfo.male"></Input>
            </FormItem>
            <FormItem label="年龄: ">
              <Input v-model="baseInfo.age"></Input>
            </FormItem>
            <FormItem label="出生日期: ">
              <Input v-model="baseInfo.bornthday"></Input>
            </FormItem>
            <FormItem label="电话:">
              <Input v-model="baseInfo.phone"></Input>
            </FormItem>
            <FormItem label="邮箱:">
              <Input type="email" v-model="baseInfo.email"></Input>
            </FormItem>
            <FormItem label="微信:">
              <Input v-model="baseInfo.wechat"></Input>
            </FormItem>
            <FormItem label="入职时间:">
              <Input v-model="baseInfo.date"></Input>
            </FormItem>
            <FormItem label="所在组:">
              <Input v-model="baseInfo.group"></Input>
            </FormItem>
            <FormItem label="在职状态:">
              <Input v-model="baseInfo.state"></Input>
            </FormItem>
            <FormItem label="生活主页:">
              <Input v-model="baseInfo.daily" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="http://www.baidu.com"></Input>
            </FormItem>
            <FormItem label="技术分享:">
              <Input v-model="baseInfo.technique" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="https://www.cnblogs.com/"></Input>
            </FormItem>
            <FormItem label="工作内容:">
              <Input v-model="baseInfo.duties" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="浦发第五轮测试bug修改"></Input>
            </FormItem>
          </Form>
        </div>
        <div slot="footer">
        </div>
      </Modal>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      baseInfo: {
        name: 'ybx',
        male: '女',
        age: 22,
        bornthday: '2018-03-09',
        phone: '674363782',
        email: 'email',
        wechat: 'wechat',
        date: '2018-03-09',
        group: '技术组',
        state: '在职',
        daily: '',
        technique: '',
        duties: ''
      },
      groupList: [
        {
          value: '技术组',
          label: '技术组'
        },
        {
          value: '业务一组',
          label: '业务一组'
        },
        {
          value: '业务二组',
          label: '业务二组'
        },
        {
          value: '业务三组',
          label: '业务三组'
        }
      ],
      stateList: [
        {
          value: '在职',
          label: '在职'
        },
        {
          value: '请假',
          label: '请假'
        },
        {
          value: '离职',
          label: '离职'
        }
      ],
      checkInfo: false,
      memberList: [
        {
          src: '',
          name: '成员1'
        },
        {
          src: '',
          name: '成员2'
        },
        {
          src: '',
          name: '成员3'
        },
        {
          src: '',
          name: '成员4'
        },
        {
          src: '',
          name: '成员5'
        },
        {
          src: '',
          name: '成员6'
        }

      ],
      hasMember: false
    }
  },
  methods: {
    showInfo() {
      this.checkInfo = true
    }
  }
}
</script>

<style lang="less" scoped>
.user-query {
  width: 100%;
  height: ~'calc(100% - 24px)';
  .title {
    font-weight: 500;
    height: 60px;
    line-height: 40px;
    font-size: 20px;
    padding: 20px 0 0 20px;
    border-bottom: 1px solid #ccc
  }
}

.box-info {
  width: 100%;
  height: ~'calc(100% - 130px)';
}

.none-base,
.base {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-around;
  align-self: center;
}

.none-base {
  .none-member {
    text-align: center;
    font-size: 72px;
    color: #ccc;
    display: flex;
    align-self: center
  }
}

.base {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-around;
  .photo {
    margin: 50px 50px 0 50px;
    img {
      width: 150px;
      height: 150px;
      background-color: #aaa
    }
  }
  .name {
    display: block;
    width: 100%;
    font-size: 16px;
    text-align: center;
    padding: 10px;
  }
}

// modal
.v-transfer-dom {
  position: relative;
  z-index: 99999;
}

.ivu-form-item {
  margin-bottom: 15px;
}

// 重写的 ivu-form-item 样式
// .form-item {
//   margin-bottom: 15px;
//   &>span {
//     float: left;
//     width: 80px;
//     line-height: 32px
//   }
//   .item-input {
//     float: right;
//     width: ~'calc(100% - 80px)';
//   }
//   &:after {
//     content: ".";
//     display: block;
//     height: 0;
//     clear: both;
//     visibility: hidden;
//   }
// }
</style>
